/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package app_files.files;

import java.util.Vector;

/**
 *
 * @author Christopher Standley
 */
public class AccessControl {
    /** Gets the file name from its title (label). */
    public static String getFileName(String name){
        if (name == null) {
            return null;
        }

        String location = "";

        Vector files = app_files.xml.ReadFile.getFileDetails("All");
        for (int n = 0; n < files.size(); n++){
            File file = (File) files.elementAt(n);
            if (file.getName().equals(name) && file.getPublished()){
                location = file.getLocation();
                break;
            }
        }

        // not found or not published
        if (location.equals("")) {
            return null;
        }

        return location;
    }
}
